package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.Sys_User;
import com.gxa.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping(value = "/addUser",method = RequestMethod.GET)
    @ResponseBody
    public R add(@RequestBody Sys_User sys_user){
        System.out.println(sys_user.getUsername()+"==="+sys_user.getNickname());
        System.out.println("===========");
        R r=new R();
        r.setCode(200);
        r.setMsg("success");
        r.setData(sys_user);
        return r;
    }
    @RequestMapping(value = "/queryUser",method = RequestMethod.GET)
    @ResponseBody
    public R queryUser(){
        return userService.queryUser();
    }
}
